package br.com.news.service;

import java.util.List;

import javax.inject.Inject;
import javax.inject.Named;

import br.com.news.utils.business.exception.BusinessException;
import br.com.news.utils.business.interfaces.IFonteBusiness;
import br.com.news.utils.database.beans.FonteBean;
import br.com.news.utils.service.exception.ServiceException;
import br.com.news.utils.service.interfaces.IFonteService;

@Named
public class FonteService implements IFonteService{

	@Inject
	private IFonteBusiness fonteBusiness;

	@Override
	public List<FonteBean> findAll() throws ServiceException {
		try {
			return fonteBusiness.findAll();
		} catch (BusinessException e) {
			throw new ServiceException(e);
		}
	}

	@Override
	public FonteBean buscaPorNome(String descricao) {
		return fonteBusiness.buscaPorNome(descricao);
	}
	
}
